import request from '@/utils/request'

// 获取列表
export function getClientList(params) {
  return request({
    url: '/clients',
    params
  })
}

// 获取数量
export function getClientNumber(params) {
  return request({
    url: '/clients/count',
    params
  })
}

// 新增客户
export function addClient(data) {
  return request({
    url: '/clients',
    data,
    method: 'post'
  })
}

// 删除客户
export function delClient(id) {
  return request({
    method: 'delete',
    url: `/clients/${id}`
  })
}

// 获取指定客户
export function getClientDetail(id) {
  return request({
    url: `/clients/${id}`
  })
}

// 编辑客户
export function editClient(data) {
  return request({
    method: 'put',
    url: `/clients/${data.id}`,
    data
  })
}
